#include <iostream>
using namespace std;
int main()
{
  int ret=1;
  int a=2019;
  int b=324;
  while(1)
  {
	if(a!=0)
	{
		ret+=a%b;
		a%=b;
	}
	else
	{
		break;
	}
  }
  cout<<ret;
  return 0;
}
